package cn.iocoder.yudao.module. enterprise.dal.mysql.studentEducationalExperience;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module. enterprise.dal.dataobject.studentEducationalExperience.EnterpriseStudentEducationalExperienceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module. enterprise.controller.admin.studentEducationalExperience.vo.*;

/**
 * 用户简历教育经历 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface EnterpriseStudentEducationalExperienceMapper extends BaseMapperX<EnterpriseStudentEducationalExperienceDO> {

    default PageResult<EnterpriseStudentEducationalExperienceDO> selectPage(EnterpriseStudentEducationalExperiencePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EnterpriseStudentEducationalExperienceDO>()
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getStudentId, reqVO.getStudentId())
                .likeIfPresent(EnterpriseStudentEducationalExperienceDO::getSchoolName, reqVO.getSchoolName())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getEducationalBackground, reqVO.getEducationalBackground())
                .betweenIfPresent(EnterpriseStudentEducationalExperienceDO::getFullTime, reqVO.getBeginFullTime(), reqVO.getEndFullTime())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getDiploma, reqVO.getDiploma())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getLevel, reqVO.getLevel())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getGrade, reqVO.getGrade())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getMajor, reqVO.getMajor())
               .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getIsOverseasStudy, reqVO.getIsOverseasStudy())
                .betweenIfPresent(EnterpriseStudentEducationalExperienceDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(EnterpriseStudentEducationalExperienceDO::getId));
    }
    default List<EnterpriseStudentEducationalExperienceDO> selectListByStudentId(Long studentId) {
        return selectList(new LambdaQueryWrapperX<EnterpriseStudentEducationalExperienceDO>()
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getStudentId, studentId)
               );
    }

    default List<EnterpriseStudentEducationalExperienceDO> selectList(EnterpriseStudentEducationalExperienceExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<EnterpriseStudentEducationalExperienceDO>()
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getStudentId, reqVO.getStudentId())
                .likeIfPresent(EnterpriseStudentEducationalExperienceDO::getSchoolName, reqVO.getSchoolName())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getEducationalBackground, reqVO.getEducationalBackground())
                .betweenIfPresent(EnterpriseStudentEducationalExperienceDO::getFullTime, reqVO.getBeginFullTime(), reqVO.getEndFullTime())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getDiploma, reqVO.getDiploma())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getLevel, reqVO.getLevel())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getGrade, reqVO.getGrade())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getMajor, reqVO.getMajor())
                .eqIfPresent(EnterpriseStudentEducationalExperienceDO::getIsOverseasStudy, reqVO.getIsOverseasStudy())
                .betweenIfPresent(EnterpriseStudentEducationalExperienceDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(EnterpriseStudentEducationalExperienceDO::getId));
    }

}
